import Vue from 'vue'
import Vuex from 'vuex'
import '../../utils/vue-extend'
import App from './App.vue'
import Router from 'vue-router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
import TaskManager from '../../components/task/TaskManager'
import TaskApprove from '../../components/task/TaskApprove'
import TaskDiagram from '../../components/task/TaskDiagram'
import ApplyManager from '../../components/task/ApplyManager'
import ProcessManager from '../../components/task/ProcessManager'

Vue.config.productionTip = false

const routes = [
    {path: '/task-manager', component: TaskManager, name: 'task-manager'},
    {path: '/task-approve', component: TaskApprove, name: 'task-approve'},
    {path: '/task-diagram', component: TaskDiagram, name: 'task-diagram'},
    {path: '/apply-manager', component: ApplyManager, name: 'apply-manager'},
    {path: '/process-manager', component: ProcessManager, name: 'process-manager'}
]

// 3. 创建 router 实例，然后传 `routes` 配置
// 你还可以传别的配置参数, 不过先这么简单着吧。
const router = new Router({
    routes: routes
})
Vue.use(Router);
Vue.use(ElementUI);
Vue.use(Vuex)

const store = new Vuex.Store({
    state: {
        approveTaskId: ''
    },
    mutations: {
        setApproveTaskId(state,taskId){
            state.approveTaskId = taskId;
        }
    }
})

new Vue({
    render: h => h(App),
    router,
    store
}).$mount('#app')
